package entity

import (
	"shqsoft.cn/pasnj/base"

	"github.com/jinzhu/gorm"
)

//BaseZSXX 经营单位中收导入
type BaseZSXX struct {
	ID   int     `gorm:"AUTO_INCREMENT;primary_key;column:ID"`
	DTID int     `gorm:"column:DTID"`
	UTID int     `gorm:"column:UTID"`
	BMMC string  `gorm:"column:BMMC"`
	DGZS float64 `gorm:"column:DGZS"`
	LSZS float64 `gorm:"column:LSZS"`
	TZX  float64 `gorm:"column:TZX"`
}

//TableName 经营单位中收导入表
func (BaseZSXX) TableName() string {
	return "T_BASE_ZSXX"
}

//BaseZSXXAfterImport 导入后执行
func BaseZSXXAfterImport(tx *gorm.DB, params map[string]string) (err error) {
	prams := make([]interface{}, 1)
	prams[0] = params["DTID"]
	tx.Exec("EXEC UP_BASE_ZSXX ?", prams...)
	return nil
}

//BaseZSXXEF 返回结构体
func BaseZSXXEF() base.EntityFunc {
	return func() interface{} {
		entity := BaseZSXX{}
		return &entity
	}
}

//BaseZSXXESF 返回结构体数组
func BaseZSXXESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []BaseZSXX
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("BaseZSXX", base.NewDefaultDao(BaseZSXXEF(), BaseZSXXESF(), nil))
	base.SetAfterCallBack("BaseZSXX", BaseZSXXAfterImport)
}
